' Detect OS architecture here. The appropriate version of devcon should then be used 
Set WshShell = WScript.CreateObject("Wscript.Shell")
osArch = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")

If osArch = "x86" then
	devconFile = "devcon32.exe"
ElseIf osArch = "AMD64" then
	devconFile = "devcon64.exe"
Else
	MsgBox"Could not detect the architecture (x86/AMD64) of your system" & vbCr & vbCr &_
	"Autoinstall procedure will quit. Please install driver manually or update script."
	wscript.quit 0
End if

'Displaying ok and cancel button.
x=MsgBox(("This will update FTDI Module drivers"),1,("FTDI driver update"))

'Install drivers if OK was pressed
If x=1 Then
	Set objShell = CreateObject("WScript.Shell")
	' Update driver for USB-COM RS232 and RS485 modules
	objShell.Run devconFile & " update ftdibus.inf USB\Vid_0403&Pid_6011&REV_0800&MI_00", 1, True
	objShell.Run devconFile & " update ftdibus.inf USB\Vid_0403&Pid_6011&REV_0800&MI_01", 1, True
	objShell.Run devconFile & " update ftdibus.inf USB\Vid_0403&Pid_6011&REV_0800&MI_02", 1, True
	objShell.Run devconFile & " update ftdibus.inf USB\Vid_0403&Pid_6011&REV_0800&MI_03", 1, True
	Wscript.Sleep 1000
	objShell.Run devconFile & " update ftdiport.inf FTDIBUS\COMPORT&VID_0403&PID_6011", 1, True
	' Update driver for USB-DIO modules
	objShell.Run devconFile & " update ftdibus.inf USB\Vid_0403&Pid_6014", 1, True
	Wscript.Sleep 1000
	objShell.Run devconFile & " update ftdiport.inf FTDIBUS\COMPORT&VID_0403&PID_6014", 1, True
End if
